import requests


def main():
        
    url = "https://qianfan.baidubce.com/v2/app/conversation/file/upload"
    
    payload = {
        'app_id': '6c31123d-6103-4e6d-a546-f8fce6555807',
        'conversation_id': 'bc45b439-c583-445b-9cfd-263e60dc47a6'
    }
    files=[
        ('file',('1.jpg',open('img/1.jpg','rb'),'image/jpeg'))
    ]
    headers = {
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-WT80OnqVYqiuiXVWpaWYc/448dafad3a1809cdd625d6aeb7b337e73556999d'
    }
    
    response = requests.request("POST", url, headers=headers, data=payload, files=files)
    
    print(response.text)
    

if __name__ == '__main__':
    main()
